package org.frog.sgs.io;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;

/**
 * @author duanxiangqi
 * @date 2012-10-22
 */
public class SgsProtocolEncoder extends ProtocolEncoderAdapter {

	public void encode(IoSession session, Object obj, ProtocolEncoderOutput out) throws Exception {
		SgsMsg msg = (SgsMsg) obj;
		out.write(msg.writeToBuffer());
	}
}
